package com.fary.security.config.annotation.web.configuration;

import com.fary.context.annotation.ImportSelector;
import com.fary.core.type.AnnotationMetadata;
import com.fary.util.ClassUtils;

class SpringWebMvcImportSelector implements ImportSelector {

	public String[] selectImports(AnnotationMetadata importingClassMetadata) {
		boolean webmvcPresent = ClassUtils.isPresent("org.springframework.web.servlet.DispatcherServlet",
				getClass().getClassLoader());
		return webmvcPresent ? new String[] {"org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration" }
				: new String[] {};
	}
}